export default {
    INIT_USER_INFO(state, userinfo) {
        state.userInfo = userinfo;
    },
    INIT_PROJECTS(state, projects) {
        state.projects = projects;
    },
    CLOSE_WELCOME(state) {
        state.welcomeFlag = false;
    },
    INIT_OPENING_PROJECTS(state, projects) {
        state.openingProjects = projects;
    },
    INIT_OPENED_PROJECTS(state, projects) {
        state.openedProjects = projects;
    },
    INIT_AUTHORIZING_PROJECTS(state, projects) {
        state.authorizingProjects = projects;
    },
    INIT_AUTHORIZED_PROJECTS(state, projects) {
        state.authorizedProjects = projects;
    },
    INIT_AUTH_ABOUT_PROJECTS(state, projects) {
        state.authProjects = projects;

    },
    INIT_APPLICATION_ABOUT_PROJECTS(state, projects) {
        if (projects.toQuest == null) {
            state.applicationProjects.getAuthed = projects.getAuthed;
        }
        else if (projects.getAuthed == null) {
            state.applicationProjects.toQuest = projects.toQuest;
        }
        else {
            state.applicationProjects.toQuest = projects.toQuest;
            state.applicationProjects.getAuthed = projects.getAuthed;

        }
    },
    INIT_POSTS(state, posts) {
        state.posts = posts;
    },
    SET_ACTIVE_TAB(state, activeValue) {
        state.activeTab = activeValue;
    },
    TOOGLE_SIDE_BAR(state) {
        state.toogleSideBar = !state.toogleSideBar;
    },
    INIT_CURRENT_PROJECT(state, project) {
        state.project = project;
    },
    INIT_CURRENT_PROJECT_INFO(state, projectInfo) {
        state.projectInfo = projectInfo;
    },
    INIT_Message_Data(state, messageData) {
        state.messageData = messageData;
    },
    INIT_BASE_DATA_INFO(state, baseDataInfo) {
        state.baseDataInfo = baseDataInfo;
    },
    INIT_MODEL_DATAS(state, modelDatas) {
        state.modelDatas = modelDatas;
    },
    // INIT_3D_DATAS(state, data) {
    //     state.threeDatas = [];
    //     if (data.length === 0) return;
    //     data.forEach(planes => {
    //         if (planes.length === 0) return;
    //         let plane = planes.name;
    //         planes.children.forEach(sites => {
    //             if (sites.length === 0) return;
    //             let site = sites.name;
    //             let machineinfo = sites.machineinfo;
    //             sites.value.forEach(points => {
    //                 let tmp = {};
    //                 tmp.ratio = points.ratio;
    //                 tmp.name = points.name;
    //                 tmp.type = points.type;
    //                 tmp.position = points.position;
    //                 tmp.unit = points.unit;
    //                 tmp.value = points.value[0];
    //                 tmp.group = points.group;
    //                 tmp.site = site;
    //                 tmp.machineinfo = machineinfo;
    //                 tmp.plane = plane;
    //                 state.threeDatas.push(tmp);
    //             });
    //         });
    //     });
    // },
    SET_TOKEN(state, token) {
        state.token = token
    }

}